/*
 * cudanGlobalMemory.h
 *
 *  Created on: Jan 7, 2010
 *      Author: daniel
 */

#ifndef CUDANGLOBALMEMORY_H_
#define CUDANGLOBALMEMORY_H_

#include "cudanDeviceMemory.h"

namespace CUDAN
{
	template<typename T, int D = 1>
	class GlobalMemory : public DeviceMemory<T,D>
	{
	public:
		GlobalMemory();
		GlobalMemory(HostMemory<T,D>*);
		GlobalMemory(DeviceMemory<T,D>*);
		GlobalMemory(GlobalMemory<T,D>*);
		GlobalMemory<T,D>* operator=(HostMemory<T,D>*);
		GlobalMemory<T,D>* operator=(DeviceMemory<T,D>*);
		GlobalMemory<T,D>* operator=(GlobalMemory<T,D>*);
		virtual ~GlobalMemory();

	public:
		virtual void freeMemory();
		virtual void print();
		virtual void print(DimensionSizeVector&);
		virtual bool allocateMemory(DimensionSizeVector&);
		virtual bool copyFrom(HostMemory<T,D>*);
		virtual bool copyFrom(DeviceMemory<T,D>*);
		virtual bool copyFrom(GlobalMemory<T,D>*);
		virtual bool copyTo(HostMemory<T,D>*);
		virtual bool copyTo(DeviceMemory<T,D>*);
		virtual bool copyTo(GlobalMemory<T,D>*);
	};
}

#include "cudanGlobalMemory.cpp"

#endif /* CUDAFWGLOBALMEMORY_H_ */
